/*
 * 作者:熊猫
 * 日期:2017 - 3 - 16 5 - 24 - 3
 *
 */

package net.lainiao.morethread.Chapter7.demo4;

import net.lainiao.morethread.Chapter7.demo3.MyTask;
import net.lainiao.morethread.Chapter7.demo3.MyThreadFactory;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;

/**
 * Created by Administrator on 2017/3/16.
 */
public class Main {
    public static void main(String[] args) {
        MyThreadFactory factory=new MyThreadFactory("MyThreadFactory");
        ExecutorService executorService= Executors.newCachedThreadPool(factory);
        MyTask task=new MyTask();
        executorService.submit(task);
        executorService.shutdown();
        try {
            executorService.awaitTermination(1, TimeUnit.DAYS);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Main Over ");

    }
}
